FRACTALS

    Useful background hints:
| What are complex numbers? |
| What is the Mandelbrot set? |
| What is the difference between Julia sets and the Mandelbrot set? |

Mandelbrot Set, gifDavid E. Joyce has made an impressive Mandelbrot-Julia-Set-Explorer at http://aleph0.clarku.edu/~djoyce/julia/explorer.html
We strongly recommend, that you try this site.


What are complex numbers?

The Mandelbrot set is the domain of convergence of the series built up by the complex sequence defined by the recursion law: Zn+1 = Z2n + C, therefore complex numbers are important to understand what the Mandelbrot set is.

If you are familiar with complex numbers, you can skip this section. If you haven't encountered complex numbers during your studies, don't worry! In order to learn what they are and how to use them to build fractals you only need some simple concepts.
A complex number is made by two parts: the real part and the imaginary part. The real part is a real number (i.e. an ordinary number), the imaginary part is another real number multiplied by i, which is called the imaginary unit and is defined as the square root of -1, so that i2 = -1.

Example: -6 + 9i is a complex number.

Now imagine a plane with two coordinate axis on it. We can associate each point of the plane with a complex number of the form: x_coordinate + i*y_coordinate.

Correspondance between complex numbers and points on the plane

We need to define some operations to deal with complex numbers:

Adding two complex numbers is very simple. Let's take two complex numbers: Z1=a1+ib1 and Z2=a2+ib2. The complex number resulting from Z1+Z2 is defined as: a1+a2+i*(b1+b2). The real part of the result is the sum of the real parts of Z1 and Z2; the imaginary part of the result is the sum of the imaginary parts of Z1 and Z2.

Example: Z1 = 2 + i , Z2 = 3 - 6i , Z1+Z2 = 5 - 5i

In order to multiply Z1 by Z2 we only need to remember the distributive law and the equation i2 = -1. Therefore, the multiplication is defined as follows: Z1*Z2 = a1*a2 - b1*b2 +i*(a1*b2 + a2*b1).

Example (with the values above): Z1*Z2 = 6 - (-6) + i*(-12 + 3) = 12 - 9i

In particular, the square of a complex number (i.e. the complex number multiplied by itself) is defined as: Z12 = a12 - b12 + 2*i*a1*b1
Don't forget the above formula, because we'll use it to build Mandelbrot and Julia sets.


What is the Mandelbrot set?

The Mandelbrot set is the domain of convergence of the series built up by the complex sequence defined by the recursion law: Zn = Zn-12 + C. In other words, with a simple algorithm it is possible to separate the points of the complex plane in two categories:

  • points inside the Mandelbrot set
  • points outside the Mandelbrot set
    The image below shows a portion of the complex plane. The points of the Mandelbrot set have been coloured black.

    It is also possible to assign a colour to the points outside the Mandelbrot set. Their colour depends on how many iterations have been required to determine that they are outside the Mandelbrot set, and it can be interpreted as their "distance" from the Mandelbrot set.


    How can I build the Mandelbrot set?
    Pick a point on the complex plane (let's call it C). The corresponding complex number has the form: x_coordinate + i*y_coordinate. Calculate the value of this expression: Z2 + C, using zero as the value of Z (the result is C). Assign the result to Z and repeat the calculation: now the result is the complex number C2+C. Assign the value to Z and repeat the process again and again. In mathematical terms, this is the iteration of the function Zn = Zn-12 + C. I like to imagine this process as the "migration" of the initial point C across the plane. What happens to the point when we repeatedly iterate the function? Will it remain near to the origin or will it go away from it, increasing its distance from the origin without limit? In the first case, we say that C belongs to the Mandelbrot set (it is one of the black points in the image); otherwise, we say that it goes to infinity and we assign a colour to C depending on the speed the point "escapes" from the origin.

    Let's take a look to the algorithm from a different point of view. Let's imagine that all the points on the plane are "attracted" either by infinity or by the Mandelbrot set. This makes easy to understand why

  • points far from the Mandelbrot set rapidly move towards infinity
  • points close to the Mandelbrot set slowly escape to infinity
  • points inside the Mandelbrot set never escape to infinity


    What is the trick?
    As you can see, it is impossible to apply the process described above, because we can't iterate the function an infinite number of times to see whether or not the point goes to infinity, but it's easy to prove that if the distance of the point from the origin becomes greater than two, it will grow without limit. Therefore, if the distance of the point from the origin reaches the value of two we can stop the iteration process because we know that the point will go to infinity, and we can assign a colour to it according to the number of iterations already done (a small number of iterations means that the point is rapidly going to infinity).
    On the other hand, if the point belongs to the Mandelbrot set its distance from the origin will never become greater than two, no matter how many iterations we do. Even if the point does not belong to the Mandelbrot set, it could take a really huge number of iterations to reveal that it will escape to infinity. In either case, we set a maximum number of iterations, after which we assume it is part of the set (and we paint it black).
    The more iterations we use, the more detailed our image will be, but the longer it will take to generate.


    Examples:
    To produce an image of the whole Mandelbrot set, we need to repeat the process described above for all the points of the complex plane whose coordinates are included in this range: -2.5 < x_coordinate < 1.5 ; -1.5 < y_coordinate < 1.5
    Let's see how to assign a colour to a particular point of the plane. Let's start with a point outside the Mandelbrot set: -0.5 + i (this means that the x_coordinate of C is -0.5 and the y_coordinate of C is 1).
    Iterating the function Z = Z2 + C will produce the following values: (the image shows the corresponding points on the complex plane).

    Step # Current_Value Distance from
    the origin
    0 -0.5 + i 1.12
    1 -1.25 1.25
    2 1.06 + i 1.46
    3 -0.37 + i * 3.1 3.15

    At the third iteration, the distance of the point from the origin becomes greater than two. This means that the initial point C does not belong to the Mandelbrot set. Since the number of iterations required to determine this is 3, we assign to C the colour labelled #3. All the points with the same colour require the same number of iterations to reveal that they are attracted by infinity.

    Let's repeat the same process with a point inside the Mandelbrot set: C = 0.2 + i * 0.5. In this case, the distance of the point from the origin never becomes greater than two. When we reach the maximum number of iterations (for example, 200), we assume that the initial point C belongs to the Mandelbrot set and we paint it black.

    Step # Current_Value Distance from
    the origin
    0 0.2 + i * 0.5 0.54
    1 -0.01 + i * 0.7 0.7
    2 -0.29 + i * 0.49 0.57
    3 0.05 + i * 0.22 0.22
    4 0.15 + i * 0.52 0.54
    5 -0.05 + i * 0.66 0.66
    6 -0.23 + i * 0.44 0.48
    7 0.06 + i * 0.3 0.3
    . . . . . . . . . . . . . . . . . .


    What is the difference between Julia sets and the Mandelbrot set?

    Julia sets are strictly connected with the Mandelbrot set. The iterative function used to produce both Mandelbrot and Julia sets is: Zn+1 = Z2n + C.
    What is different is the way this formula is used. Each point of the complex plane is associated with a Julia set, so you can think to the Mandelbrot set as an "index" of all the Julia sets: each point of the Mandelbrot set is associated with a particular Julia set.


    How can I build a Julia set?

    The process of building a Julia set is the same used for the Mandelbrot set. The only difference is that for the Julia set C is fixed, while Z varies.

    Pick a point on the complex plane (let's call it C). The corresponding complex number has the form: x_coordinate + i*y_coordinate. The following algorithm will produce the Julia set associated with C: in other words, given a generic point Z on the complex plane this algorithm determines whether or not the point Z belongs to the Julia set associated with C.
    In order to see if Z belongs to the set, we must iterate the function Z2+C using Z as the initial value. What happens to the initial point Z when the formula is iterated? Will it remain near to the origin or will it go away from it, increasing its distance from the origin without limit? In the first case, it belongs to the Julia set; otherwise it goes to infinity (infinity is an attractor for the point) and we assign a colour to Z depending on the speed the point "escapes" from the origin. To produce an image of the whole Julia set associated with C, we must repeat the process described above for all the points of the complex plane whose coordinates are included in this range: -2 < x_coordinate < 2 ; -1.5 < y_coordinate < 1.5 .

    Note that whilst the Mandelbrot set is connected (i.e. it is a single piece), a Julia set is connected only if it is associated with a point inside the Mandelbrot set.
    Example: the Julia set associated with C1 is connected; the Julia set associated with C2 is not connected (see image below).

    Example of connected and not connected Julia sets


    What is the trick this time?

    The method used to produce images representing the Julia sets is the same used for the Mandelbrot set. If the distance of the point from the origin becomes bigger than two, we are sure that it will grow without limit. Therefore, if this distance reaches the value of two, we can stop the iteration process because we know that the point will go to infinity, and we can colour the point according to the number of iterations already done (a great number of iterations means that the point is going to infinity slowly). If the point belongs to the Julia set, its distance from the origin will never become greater than two, no matter how many iterations we do.
    Even if the point does not belong to the Julia set, it could take a really huge number of iterations to reveal that it is attracted by infinity. In either case, we set a maximum number of iterations, after which we assume it is part of the Julia set (colouring it black).
    The more iterations we use, the more detailed our image will be, but the longer it will take to generate.


    En kurve kan udfylde et areal

    se kurven på http://www.cut-the-knot.com/do_you_know/hilbert.html, hvor en Java-Applet danner kurven
    En forkortet version er lagt her

    Disse kurver kaldes Peano-kurver. (G. Peano, matematiker, 1858-1932) Peano's eksempel er her (gif-billede)


    En definition på "fractal"

    tekst hentet på http://fractal.mta.ca/sci.fractals-faq/whatis.html

    Subject: What is a fractal?

    Question: What is a fractal? What are some examples of fractals?

    Answer: A fractal is a rough or fragmented geometric shape that can be subdivided in parts, each of which is (at least approximately) a reduced-size copy of the whole. Fractals are generally self-similar and independent of scale.

    There are many mathematical structures that are fractals; e.g. Sierpinski triangle, Koch snowflake, Peano curve, Mandelbrot set, and Lorenz attractor. Fractals also describe many real-world objects, such as clouds, mountains, turbulence, coastlines, roots, branches of trees, blood vesels, and lungs of animals, that do not correspond to simple geometric shapes.

    Benoit B. Mandelbrot gives a mathematical definition of a fractal as a set of which the Hausdorff Besicovich dimension strictly exceeds the topological dimension. However, he is not satisfied with this definition as it excludes sets one would consider fractals.

    According to Mandelbrot, who invented the word: "I coined fractal from the Latin adjective fractus. The corresponding Latin verb frangere means "to break:" to create irregular fragments. It is therefore sensible - and how appropriate for our needs! - that, in addition to "fragmented" (as in fraction or refraction), fractus should also mean "irregular," both meanings being preserved in fragment." (The Fractal Geometry of Nature, page 4.)


    Due thanks are given to http://www.geocities.com/CapeCanaveral/2854/
    Fabio Cesari, fabioc@geocities.com

    Siden opdateret 11.8.98. N.B.Olsen, DTV